package com.suyang.syt.dao.impl;

import org.springframework.stereotype.Repository;

import com.suyang.syt.dao.interfaces.WeixinMsgReceiveDao;
import com.suyang.syt.model.WeixinMsgReceive;

@Repository
public class WeixinMsgReceiveDaoImpl extends BaseDaoImpl<WeixinMsgReceive> implements WeixinMsgReceiveDao {

	@Override
	public long countByCreateTime(long createTime, String fromUserName) {
		String hql = " select count(*) from WeixinMsgReceive where CreateTime=? and FromUserName=? ";
		return (Long) this.queryByHql(hql, new Object[] { createTime, fromUserName });
	}

	@Override
	public void updatePicName(long id, String fileName) {
		String hql = " update WeixinMsgReceive set uploadPicName=? where id=? ";
		this.executeByHql(hql, new Object[] { fileName, id });
	}

	@Override
	public void deletes(String ids) {
		String hql = " delete from WeixinMsgReceive where id in(" + ids + ")";
		this.executeByHql(hql);
	}

}
